FROM registry.cn-beijing.aliyuncs.com/lijiajia/java:11-jdk-alpine3
MAINTAINER lijiajia

WORKDIR /cairo/auth/service
COPY dependencies/ ./
COPY snapshot-dependencies/ ./
COPY spring-boot-loader/ ./
COPY application/ ./

ENV SPRING_PROFILES_ACTIVE container
ENV JVM_OPS ''
ENV JAVA_OPS '--add-exports java.desktop/sun.font=ALL-UNNAMED'
ENTRYPOINT ["sh", "-c","exec java $JVM_OPTS $JAVA_OPTS org.springframework.boot.loader.JarLauncher"]

VOLUME /cairo/auth/service/logs

EXPOSE 80/tcp 9000/tcp
#HEALTHCHECK --start-period=10s \
#            --interval=10s \
#            --timeout=5s \
#            --retries=5 \
#            CMD curl --silent --fail --request GET http://localhost:9000/actuator/health | jq --exit-status '.status == "UP"' || exit 1
